#ifndef __M_LEVEL__
#define __M_LEVEL__
// 定义日志等级，并转化为字符串

namespace wzh
{
    class LogLevel
    {
    public:
        enum class values
        {
            UNKNOW = 0,
            DEBUG,
            INFO,
            WARN,
            ERROR,
            FATAL,
            OFF
        };

        static const char* toString(LogLevel::values level)
        {
            switch (level)
            {
            case LogLevel::values::DEBUG: return "DEBUG";
            case LogLevel::values::INFO: return "INFO";
            case LogLevel::values::WARN: return "WARN";
            case LogLevel::values::ERROR: return "ERROR";
            case LogLevel::values::FATAL: return "FATAL";
            case LogLevel::values::OFF: return "OFF";
            default:
                return "UNKNOW";
            }
        }
    };
}

#endif